SetGfxDriver 1:Graphics 1024,768,8,2:SeedRnd MilliSecs() :SetBuffer FrontBuffer() 
Global zzz1
:Dim zzz(66666)
:Dim t2 (300):Dim tz2 (300)

While Not KeyHit(1) 
ClsColor 0,0,0
Cls

t1 = Rand(0,255):For i=0 To 60: tz2(i*5) = Rand(0,65535): t2(i*5)=tz2(i*5):Next:t3 = Rand(0,255)
Text 10,22,""+t1+"   "+t2(0)+"  "+t3,False ,False 
For i=0 To 60
	tt2 = t2(i*5)
	z1=(tt2 Xor t1 )
	z2= (tt2 Xor (t3*256))
	t4 = ( z1 Xor z2 )
	t2(i*5)=t4
Next
;Text 10,42,""+z1+" "+ z2+" ",False ,False

cnt=0
;WaitMouse()
sflag=0
For i=0 To 60

For i1=0 To 255
For i3=0 To 255
	tt2 = t2(i*5)
	z1=(tt2 Xor  i1)
	z2= (tt2 Xor (i3*256))
	i4 = ( z1 Xor z2 )
	t4 = Rand(0,65535);tz2(i*5);
	If i4=t4 Then sflag=1
	For iii=1 To 60
	If  t2(i*5)=tz2(i*5) Then sflag=1
	Next
Next	
Next

If sflag = 1 Then cnt=cnt+1:sflag=0
Next
If cnt> 60 Then zzz(zzz1)=zzz(zzz1)+1

	For i=0 To zzz1
	Color 255,255,0:Text 15+(i*12) Mod 960,110+68*Int(i/80),Str(zzz(i))+",",False ,False 
	Next	


;For i1=0 To 65535
;z1=(i1 Xor t1)
;z2=(i1 Xor (t3*256)Xor (t3*16))
;i4=( z2 Xor z1 )
;If i4=t4 Then cnt=cnt+1
;Next

Text 10,42,""+cnt+"  ",False ,False 

zzz1=zzz1+1
Flip
If zzz1> 9999 Then  WaitMouse() 
VWait 
Wend 